package com.example.zxw.datalayer.source

import com.example.zxw.entity.ChannelEntity
import com.example.zxw.entity.HotWordsEntity
import com.example.zxw.entity.NewsListEntity
import com.example.zxw.net.ApiResult
import com.example.zxw.net.NewsApiService
import retrofit2.http.GET


class NewsNetSource {


    suspend fun getChannelList(): ApiResult<List<ChannelEntity>> {
        return NewsApiService.getChannelList()
    }

    /**
     * 获取热词
     */
    suspend fun getHotWords(language: String): ApiResult<List<HotWordsEntity>> {
        return NewsApiService.getHotWords(language)
    }


    suspend fun getNewsList(cname: String, pageIndex: Int): ApiResult<List<NewsListEntity>> {

        val language: String = ""
        val userId = ""
        return NewsApiService.getNewsList(cname, pageIndex, language, userId)
    }


}